function Screen() {
	this._$container = $(document.body);
    this.init();
}
Screen.prototype.init = function() {
    //先设定高度
    this.render();
    $('#full_screen').height($(window).height() - 80);
    this.eventCenter();
    this.goDown();
};
Screen.prototype.render = function() {
    var template = __inline("./fullscreen.tmpl");
    var content = template({});
    this._$container.prepend(content);
    
};
Screen.prototype.goDown = function() {
    if($('#full_screen').height() <= 530) {
        $('.button_group').hide();
    }
    $('.go_down').hide();
    if($('#full_screen').height() >= 564) {
        $('.go_down').show();
        if($('#full_screen').height() > 650) {
            $('.go_down').css('position','absolute');
            $('.go_down').css('bottom','50px');
            var left = $('#full_screen').width()/2 - 32;
            $('.go_down').css('left',left);
            var anArrow = setInterval(function() {
                $('.go_down').animate({bottom:'0px',opacity:'0.2'},'slow');
                $('.go_down').animate({bottom:'50px',opacity:'1'},'slow');
            }, 1000);
        }
    }
    $('.go_down').bind('click',function() {
        window.scroll(0, $('#full_screen').height());
    });
};

Screen.prototype.eventCenter = function() {
    var me = this;
	$(window).bind('resize',function () {
		$('#full_screen').height($(window).height() - 80);		
	});
    $(window).bind('scroll' ,function() {
        me.transparent();
    })
    $('.what_zrb').bind('click',function() {
        window.scroll(0,$('.theory_section').position()['top'] - 140);
    });
};
Screen.prototype.transparent = function() {
    var height = $(window).height();
    var top = $(document).scrollTop();
    if(top < height - 80) {
        var opacity = 1 -  top / (height - 80) + 0.2;
        var alpha = 100 * opacity;
        $('#full_screen .main_container').css('filter', 'alpha(opacity=' + alpha + ')');
        $('#full_screen .main_container').css('opacity', opacity);
        $('#full_screen .main_container').css('-moz-opacity', opacity);
        $('#full_screen .main_container').css('-khtml-opacity', opacity);        
    }
}
module.exports = Screen;